import { AxiosPromise } from 'axios'
// @ts-ignore
import request from '/@/utils/request'

const prefixOrder = '/api_dms/order/'
const prefix = '/api_dms/'

// 客户买方列表接口
export const getCustomerCategoryList: () => AxiosPromise = () =>
  request(`${prefixOrder}categoryList`)

// 客户买方列表接口
export const getCustomerProductList: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}product/list`, { data })

  // 二级类目
export const getHomeProductSearch: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}product/search`, { data })

// 客户买方列表接口
export const homeAddressParse: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}address/parse`, { data })

// 产品列表接口
export const homeProductSearchSelect: (data:object) => AxiosPromise = (data) =>
  request(`api_dms/product/searchSelect`, { data })


/* 新版首页接口 */
// 筛选下级分类用这
export const homeProductSearchClass: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}product/searchClass`, { data })

// 首页公告
export const getArticleList: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}article/list`, { data })

// 排行榜
export const getOrderDetailRank: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}getOrderDetailRank`, { data })

// 数据分析
export const getOrderLineChart: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}getOrderLineChart`, { data })

// 业务统计
export const getOrderGroupTotal: () => AxiosPromise = () =>
  request(`${prefix}getOrderGroupTotal`)

// 新增账号
export const createAccount: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}account/create`, { data })

// 重置账号
export const resetAccount: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}account/reset`, { data })

// 获取物流信息
export const getExpressList: (data:object) => AxiosPromise = (data) =>
  request(`${prefix}express/list`, { data })



